(function () { "use strict"; (function(){"use strict";try{if(typeof document!="undefined"){var e=document.createElement("style");e.id="intercept-stylesheet",e.appendChild(document.createTextNode('html body{margin:0!important}html body .sr-only{position:absolute;margin:-1px;border:0;padding:0;width:1px;height:1px;overflow:hidden;white-space:nowrap;clip:rect(0,0,0,0)}html body .frame-content{height:100%}html body .frame-content .header{display:flex;flex-direction:row-reverse;justify-content:space-between;align-items:center;box-sizing:border-box;width:100%}html body .frame-content .survey-loader{display:flex;position:absolute;justify-content:center;align-items:center;background-color:#fff;width:100%;height:100%}html body .frame-content .buttonContainer{display:flex;flex-direction:row;gap:6px}html body .frame-content .buttonContainer .button{display:flex;justify-content:center;align-items:center;gap:12px;cursor:pointer;border:0;border-radius:12px;background-color:#0a86ea;min-width:36px;height:35px;font-style:normal;font-weight:400;font-size:14px;line-height:16px;font-family:Roboto,sans serif}html body .frame-content .buttonContainer .button:hover{opacity:.7}html body .frame-content .widgetName{overflow:"hidden";text-overflow:"ellipsis";white-space:"nowrap"}html body .frame-content .surveyFrame{box-sizing:border-box;overflow:hidden}html body .frame-content .surveyFrame .launch-survey_container{padding:10px;position:relative}html body .frame-content .surveyFrame .launch-survey_container-widgetDescription{width:100%}html body .frame-content .surveyFrame .launch-survey_container-launchSurvey{cursor:pointer;border:none;border-radius:5px;padding:8px 16px;font-size:16px}html body .frame-content .surveyFrame .widget-description-btn-content{display:flex;flex-direction:column;justify-content:center;align-items:center;width:100%;overflow:visible;text-align:center}html body .frame-content .surveyFrame .widget-description-btn-content>div:first-child{margin:10px}')),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})(); var Bo=Object.defineProperty,Vo=Object.defineProperties;var Wo=Object.getOwnPropertyDescriptors;var Lr=Object.getOwnPropertySymbols;var jo=Object.prototype.hasOwnProperty,Go=Object.prototype.propertyIsEnumerable;var Or=(K,g,J)=>g in K?Bo(K,g,{enumerable:!0,configurable:!0,writable:!0,value:J}):K[g]=J,M=(K,g)=>{for(var J in g||(g={}))jo.call(g,J)&&Or(K,J,g[J]);if(Lr)for(var J of Lr(g))Go.call(g,J)&&Or(K,J,g[J]);return K},z=(K,g)=>Vo(K,Wo(g));(function(){"use strict";var K,g,J,fe,Vt,Wt,jt,at,Me,Le,Gt,it,st,ct,Kt,$e={},Be=[],xr=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Oe=Array.isArray;function oe(e,t){for(var n in t)e[n]=t[n];return e}function ut(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function ae(e,t,n){var r,a,o,i={};for(o in t)o=="key"?r=t[o]:o=="ref"?a=t[o]:i[o]=t[o];if(arguments.length>2&&(i.children=arguments.length>3?K.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(o in e.defaultProps)i[o]===void 0&&(i[o]=e.defaultProps[o]);return xe(e,i,r,a,null)}function xe(e,t,n,r,a){var o={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:a==null?++J:a,__i:-1,__u:0};return a==null&&g.vnode!=null&&g.vnode(o),o}function Yt(){return{current:null}}function Z(e){return e.children}function te(e,t){this.props=e,this.context=t}function ge(e,t){if(t==null)return e.__?ge(e.__,e.__i+1):null;for(var n;tt&&fe.sort(jt),e=fe.shift(),t=fe.length,kr(e)}finally{fe.length=Ve.__r=0}}function Qt(e,t,n,r,a,o,i,c,u,s,_){var l,h,d,C,R,p,f,m=r&&r.__k||Be,T=t.length;for(u=Pr(n,t,m,u,T),l=0;l0?i=e.__k[o]=xe(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):e.__k[o]=i,u=o+h,i.__=e,i.__b=e.__b+1,c=null,(s=i.__i=Ur(i,n,u,l))!=-1&&(l--,(c=n[s])&&(c.__u|=2)),c==null||c.__v==null?(s==-1&&(a>_?h--:a<_&&h++),typeof i.type!="function"&&(i.__u|=4)):s!=u&&(s==u-1?h--:s==u+1?h++:(s>u?h--:h++,i.__u|=4))):e.__k[o]=null;if(l)for(o=0;o<_;o++)(c=n[o])!=null&&(2&c.__u)==0&&(c.__e==r&&(r=ge(c)),tn(c,c));return r}function Xt(e,t,n,r){var a,o;if(typeof e.type=="function"){for(a=e.__k,o=0;a&&o(_?1:0)){for(a=n-1,o=n+1;a>=0||o=0?a--:o++])!=null&&(2&s.__u)==0&&c==s.key&&u==s.type)return i}return-1}function Jt(e,t,n){t[0]=="-"?e.setProperty(t,n==null?"":n):e[t]=n==null?"":typeof n!="number"||xr.test(t)?n:n+"px"}function We(e,t,n,r,a){var o,i;e:if(t=="style")if(typeof n=="string")e.style.cssText=n;else{if(typeof r=="string"&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||Jt(e.style,t,"");if(n)for(t in n)r&&n[t]==r[t]||Jt(e.style,t,n[t])}else if(t[0]=="o"&&t[1]=="n")o=t!=(t=t.replace(Gt,"$1")),i=t.toLowerCase(),t=i in e||t=="onFocusOut"||t=="onFocusIn"?i.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=n,n?r?n[Le]=r[Le]:(n[Le]=it,e.addEventListener(t,o?ct:st,o)):e.removeEventListener(t,o?ct:st,o);else{if(a=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=n==null?"":n;break e}catch(c){}typeof n=="function"||(n==null||n===!1&&t[4]!="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&n==1?"":n))}}function Zt(e){return function(t){if(this.l){var n=this.l[t.type+e];if(t[Me]==null)t[Me]=it++;else if(t[Me]0?e:Oe(e)?e.map(en):oe({},e)}function Nr(e,t,n,r,a,o,i,c,u){var s,_,l,h,d,C,R,p=n.props||$e,f=t.props,m=t.type;if(m=="svg"?a="http://www.w3.org/2000/svg":m=="math"?a="http://www.w3.org/1998/Math/MathML":a||(a="http://www.w3.org/1999/xhtml"),o!=null){for(s=0;s2&&(c.children=arguments.length>3?K.call(arguments,2):n),xe(e.type,c,r||e.key,a||e.ref,null)}function je(e){function t(n){var r,a;return this.getChildContext||(r=new Set,(a={})[t.__c]=this,this.getChildContext=function(){return a},this.componentWillUnmount=function(){r=null},this.shouldComponentUpdate=function(o){this.props.value!=o.value&&r.forEach(function(i){i.__e=!0,lt(i)})},this.sub=function(o){r.add(o);var i=o.componentWillUnmount;o.componentWillUnmount=function(){r&&r.delete(o),i&&i.call(o)}}),n.children}return t.__c="__cC"+Kt++,t.__=e,t.Provider=t.__l=(t.Consumer=function(n,r){return n.children(r)}).contextType=t,t}K=Be.slice,g={__e:function(e,t,n,r){for(var a,o,i;t=t.__;)if((a=t.__c)&&!a.__)try{if((o=a.constructor)&&o.getDerivedStateFromError!=null&&(a.setState(o.getDerivedStateFromError(e)),i=a.__d),a.componentDidCatch!=null&&(a.componentDidCatch(e,r||{}),i=a.__d),i)return a.__E=a}catch(c){e=c}throw e}},J=0,te.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=oe({},this.state),typeof e=="function"&&(e=e(oe({},n),this.props)),e&&oe(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),lt(this))},te.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),lt(this))},te.prototype.render=Z,fe=[],Wt=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,jt=function(e,t){return e.__v.__b-t.__v.__b},Ve.__r=0,at=Math.random().toString(8),Me="__d"+at,Le="__a"+at,Gt=/(PointerCapture)$|Capture$/i,it=0,st=Zt(!1),ct=Zt(!0),Kt=0;var Mr=0;function E(e,t,n,r,a,o){t||(t={});var i,c,u=t;if("ref"in u)for(c in u={},t)c=="ref"?i=t[c]:u[c]=t[c];var s={type:e,props:u,key:n,ref:i,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Mr,__i:-1,__u:0,__source:a,__self:o};if(typeof e=="function"&&(i=e.defaultProps))for(c in i)u[c]===void 0&&(u[c]=i[c]);return g.vnode&&g.vnode(s),s}var le,O,pt,rn,Ee=0,on=[],P=g,an=P.__b,sn=P.__r,cn=P.diffed,un=P.__c,ln=P.unmount,_n=P.__;function pe(e,t){P.__h&&P.__h(O,e,Ee||t),Ee=0;var n=O.__H||(O.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function j(e){return Ee=1,Ge(dn,e)}function Ge(e,t,n){var r=pe(le++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):dn(void 0,t),function(c){var u=r.__N?r.__N[0]:r.__[0],s=r.t(u,c);u!==s&&(r.__N=[s,r.__[1]],r.__c.setState({}))}],r.__c=O,!O.__f)){var a=function(c,u,s){if(!r.__c.__H)return!0;var _=r.__c.__H.__.filter(function(h){return h.__c});if(_.every(function(h){return!h.__N}))return!o||o.call(this,c,u,s);var l=r.__c.props!==c;return _.some(function(h){if(h.__N){var d=h.__[0];h.__=h.__N,h.__N=void 0,d!==h.__[0]&&(l=!0)}}),o&&o.call(this,c,u,s)||l};O.__f=!0;var o=O.shouldComponentUpdate,i=O.componentWillUpdate;O.componentWillUpdate=function(c,u,s){if(this.__e){var _=o;o=void 0,a(c,u,s),o=_}i&&i.call(this,c,u,s)},O.shouldComponentUpdate=a}return r.__N||r.__}function D(e,t){var n=pe(le++,3);!P.__s&>(n.__H,t)&&(n.__=e,n.u=t,O.__H.__h.push(n))}function Se(e,t){var n=pe(le++,4);!P.__s&>(n.__H,t)&&(n.__=e,n.u=t,O.__h.push(n))}function U(e){return Ee=5,N(function(){return{current:e}},[])}function ht(e,t,n){Ee=6,Se(function(){if(typeof e=="function"){var r=e(t());return function(){e(null),r&&typeof r=="function"&&r()}}if(e)return e.current=t(),function(){return e.current=null}},n==null?n:n.concat(e))}function N(e,t){var n=pe(le++,7);return gt(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function k(e,t){return Ee=8,N(function(){return e},t)}function ke(e){var t=O.context[e.__c],n=pe(le++,9);return n.c=e,t?(n.__==null&&(n.__=!0,t.sub(O)),t.props.value):e.__}function vt(e,t){P.useDebugValue&&P.useDebugValue(t?t(e):e)}function $r(e){var t=pe(le++,10),n=j();return t.__=e,O.componentDidCatch||(O.componentDidCatch=function(r,a){t.__&&t.__(r,a),n[1](r)}),[n[0],function(){n[1](void 0)}]}function mt(){var e=pe(le++,11);if(!e.__){for(var t=O.__v;t!==null&&!t.__m&&t.__!==null;)t=t.__;var n=t.__m||(t.__m=[0,0]);e.__="P"+n[0]+"-"+n[1]++}return e.__}function Br(){for(var e;e=on.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(Ke),t.__h.some(yt),t.__h=[]}catch(n){t.__h=[],P.__e(n,e.__v)}}}P.__b=function(e){O=null,an&&an(e)},P.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),_n&&_n(e,t)},P.__r=function(e){sn&&sn(e),le=0;var t=(O=e.__c).__H;t&&(pt===O?(t.__h=[],O.__h=[],t.__.some(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(t.__h.some(Ke),t.__h.some(yt),t.__h=[],le=0)),pt=O},P.diffed=function(e){cn&&cn(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(on.push(t)!==1&&rn===P.requestAnimationFrame||((rn=P.requestAnimationFrame)||Vr)(Br)),t.__H.__.some(function(n){n.u&&(n.__H=n.u),n.u=void 0})),pt=O=null},P.__c=function(e,t){t.some(function(n){try{n.__h.some(Ke),n.__h=n.__h.filter(function(r){return!r.__||yt(r)})}catch(r){t.some(function(a){a.__h&&(a.__h=[])}),t=[],P.__e(r,n.__v)}}),un&&un(e,t)},P.unmount=function(e){ln&&ln(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.some(function(r){try{Ke(r)}catch(a){t=a}}),n.__H=void 0,t&&P.__e(t,n.__v))};var fn=typeof requestAnimationFrame=="function";function Vr(e){var t,n=function(){clearTimeout(r),fn&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);fn&&(t=requestAnimationFrame(n))}function Ke(e){var t=O,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),O=t}function yt(e){var t=O;e.__c=e.__(),O=t}function gt(e,t){return!e||e.length!==t.length||t.some(function(n,r){return n!==e[r]})}function dn(e,t){return typeof t=="function"?t(e):t}var he=(e=>(e.MATCHED="MATCHED",e.LAUNCHED="LAUNCHED",e.EXCLUDED="EXCLUDED",e))(he||{}),I=(e=>(e.TOP_LEFT="TOP_LEFT",e.TOP_CENTER="TOP_CENTER",e.TOP_RIGHT="TOP_RIGHT",e.BOTTOM_LEFT="BOTTOM_LEFT",e.BOTTOM_CENTER="BOTTOM_CENTER",e.BOTTOM_RIGHT="BOTTOM_RIGHT",e.CENTER_LEFT="CENTER_LEFT",e.CENTER_CENTER="CENTER_CENTER",e.CENTER_RIGHT="CENTER_RIGHT",e))(I||{}),ie=(e=>(e.Feedback="FEEDBACK",e.Popup="POPUP",e.Exit="EXIT",e))(ie||{}),Ye=(e=>(e.Button="BUTTON",e.Logo="LOGO",e))(Ye||{});const pn={colors:{textColor:"",backgroundColor:"",iconColor:""},headerHeight:"",widgetName:"",widgetDescription:"",fontSize:20,position:null,fontFamily:"",feedbackBtnHeight:0,feedbackBtnWidth:0,widgetWindowHeight:0,widgetWindowWidth:0,imageKey:"",imageDetailsObject:null,descriptionDetailsObject:null,logoNameObject:{feedbackLogoKey:"",feedbackLogoName:"",isTransparent:!1,feedbackBtnType:Ye.Button},isAutoLaunchEnabled:!1,launchSurveyBtnObject:{name:""}},hn=je(pn),Wr=({children:e})=>{const[t,n]=j(pn),r=k(a=>{const o=a.widgetSettings;n({colors:{textColor:o.colors.textColor,backgroundColor:o.colors.backgroundColor,iconColor:o.colors.iconColor},fontSize:o.fontSize,headerHeight:`${o.headerHeight}px`,widgetName:o.widgetName,widgetDescription:o.widgetDescription,position:o.position,fontFamily:o.fontFamily,feedbackBtnHeight:o.feedbackBtnHeight,feedbackBtnWidth:o.feedbackBtnWidth,widgetWindowHeight:o==null?void 0:o.widgetWindowHeight,widgetWindowWidth:o==null?void 0:o.widgetWindowWidth,imageKey:o.imageKey||"",imageDetailsObject:o.imageDetailsObject||null,descriptionDetailsObject:o.descriptionDetailsObject||null,logoNameObject:o.logoNameObject,isAutoLaunchEnabled:o==null?void 0:o.isAutoLaunchEnabled,launchSurveyBtnObject:o==null?void 0:o.launchSurveyBtnObject})},[]);return E(hn.Provider,{value:z(M({},t),{fetchWidgetSettings:r}),children:e})},vn=()=>ke(hn),jr=e=>{const t=Date.now();return new Date(t+e).toString()},ve=(e,t,n)=>t===ie.Feedback||n?0:e,Gr={getExpirationDate:jr,getSurveyPosition:(e,t,n,r)=>{if(!e)return null;if(t&&n!==ie.Feedback)return{bottom:0,right:r?0:12};switch(e){case I.BOTTOM_RIGHT:return{bottom:0,right:ve(12,n,r)};case I.BOTTOM_CENTER:return{bottom:0,left:"50%",transform:"translateX(-50%)"};case I.BOTTOM_LEFT:return{bottom:0,left:ve(12,n,r)};case I.CENTER_LEFT:return{top:"50%",left:ve(12,n,r),transform:"translateY(-50%)"};case I.CENTER_CENTER:return{top:"50%",left:"50%",transform:"translate(-50%, -50%)"};case I.CENTER_RIGHT:return{top:"50%",transform:"translateY(-50%)",right:ve(12,n,r)};case I.TOP_LEFT:return{top:0,left:ve(12,n,r)};case I.TOP_CENTER:return{top:0,left:"50%",transform:"translateX(-50%)"};case I.TOP_RIGHT:return{top:0,right:ve(12,n,r)};default:return{bottom:0,right:ve(12,n,r)}}}},qe=()=>{const[e,t]=j(!1);return D(()=>{const n=window.matchMedia("(max-width: 768px)");t(n.matches);const r=a=>t(a.matches);return n.addEventListener("change",r),()=>n.removeEventListener("change",r)},[]),e},Kr="https://intercept-api.questionpro.com",Yr="https://d3aj4b240xfp71.cloudfront.net",mn={generateAwsUrl:e=>e?`${Yr}/${e}`:""};function qr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Qr(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var a=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,a.get?a:{enumerable:!0,get:function(){return e[r]}})}),n}var Tt={},Ce={};function yn(e,t){for(var n in t)e[n]=t[n];return e}function Et(e,t){for(var n in e)if(n!=="__source"&&!(n in t))return!0;for(var r in t)if(r!=="__source"&&e[r]!==t[r])return!0;return!1}function St(e,t){var n=t(),r=j({t:{__:n,u:t}}),a=r[0].t,o=r[1];return Se(function(){a.__=n,a.u=t,Ct(a)&&o({t:a})},[e,n,t]),D(function(){return Ct(a)&&o({t:a}),e(function(){Ct(a)&&o({t:a})})},[e]),n}function Ct(e){try{return!((t=e.__)===(n=e.u())&&(t!==0||1/t==1/n)||t!=t&&n!=n)}catch(r){return!0}var t,n}function bt(e){e()}function Rt(e){return e}function wt(){return[!1,bt]}var It=Se;function Qe(e,t){this.props=e,this.context=t}function gn(e,t){function n(a){var o=this.props.ref;return o!=a.ref&&o&&(typeof o=="function"?o(null):o.current=null),t?!t(this.props,a)||o!=a.ref:Et(this.props,a)}function r(a){return this.shouldComponentUpdate=n,ae(e,a)}return r.displayName="Memo("+(e.displayName||e.name)+")",r.__f=r.prototype.isReactComponent=!0,r.type=e,r}(Qe.prototype=new te).isPureReactComponent=!0,Qe.prototype.shouldComponentUpdate=function(e,t){return Et(this.props,e)||Et(this.state,t)};var Tn=g.__b;g.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),Tn&&Tn(e)};var Xr=typeof Symbol!="undefined"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function En(e){function t(n){var r=yn({},n);return delete r.ref,e(r,n.ref||null)}return t.$$typeof=Xr,t.render=e,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}var Sn=function(e,t){return e==null?null:ue(ue(e).map(t))},Cn={map:Sn,forEach:Sn,count:function(e){return e?ue(e).length:0},only:function(e){var t=ue(e);if(t.length!==1)throw"Children.only";return t[0]},toArray:ue},Jr=g.__e;g.__e=function(e,t,n,r){if(e.then){for(var a,o=t;o=o.__;)if((a=o.__c)&&a.__c)return t.__e==null&&(t.__e=n.__e,t.__k=n.__k),a.__c(e,t)}Jr(e,t,n,r)};var bn=g.unmount;function Rn(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(r){typeof r.__c=="function"&&r.__c()}),e.__c.__H=null),(e=yn({},e)).__c!=null&&(e.__c.__P===n&&(e.__c.__P=t),e.__c.__e=!0,e.__c=null),e.__k=e.__k&&e.__k.map(function(r){return Rn(r,t,n)})),e}function wn(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(r){return wn(r,t,n)}),e.__c&&e.__c.__P===t&&(e.__e&&n.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=n)),e}function Pe(){this.__u=0,this.o=null,this.__b=null}function In(e){var t=e.__&&e.__.__c;return t&&t.__a&&t.__a(e)}function Dn(e){var t,n,r,a=null;function o(i){if(t||(t=e()).then(function(c){c&&(a=c.default||c),r=!0},function(c){n=c,r=!0}),n)throw n;if(!r)throw t;return a?ae(a,i):null}return o.displayName="Lazy",o.__f=!0,o}function be(){this.i=null,this.l=null}g.unmount=function(e){var t=e.__c;t&&(t.__z=!0),t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),bn&&bn(e)},(Pe.prototype=new te).__c=function(e,t){var n=t.__c,r=this;r.o==null&&(r.o=[]),r.o.push(n);var a=In(r.__v),o=!1,i=function(){o||r.__z||(o=!0,n.__R=null,a?a(u):u())};n.__R=i;var c=n.__P;n.__P=null;var u=function(){if(!--r.__u){if(r.state.__a){var s=r.state.__a;r.__v.__k[0]=wn(s,s.__c.__P,s.__c.__O)}var _;for(r.setState({__a:r.__b=null});_=r.o.pop();)_.__P=c,_.forceUpdate()}};r.__u++||32&t.__u||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(i,i)},Pe.prototype.componentWillUnmount=function(){this.o=[]},Pe.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=Rn(this.__b,n,r.__O=r.__P)}this.__b=null}var a=t.__a&&ae(Z,null,e.fallback);return a&&(a.__u&=-33),[ae(Z,null,t.__a?null:e.children),a]};var An=function(e,t,n){if(++n[1]===n[0]&&e.l.delete(t),e.props.revealOrder&&(e.props.revealOrder[0]!=="t"||!e.l.size))for(n=e.i;n;){for(;n.length>3;)n.pop()();if(n[1]>>1,1),t.h.removeChild(a)}}}Te(ae(Zr,{context:t.context},e.__v),t.v)}function Ln(e,t){var n=ae(zr,{__v:e,h:t});return n.containerInfo=t,n}(be.prototype=new te).__a=function(e){var t=this,n=In(t.__v),r=t.l.get(e);return r[0]++,function(a){var o=function(){t.props.revealOrder?(r.push(a),An(t,e,r)):a()};n?n(o):o()}},be.prototype.render=function(e){this.i=null,this.l=new Map;var t=ue(e.children);e.revealOrder&&e.revealOrder[0]==="b"&&t.reverse();for(var n=t.length;n--;)this.l.set(t[n],this.i=[1,0,this.i]);return e.children},be.prototype.componentDidUpdate=be.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,n){An(e,n,t)})};var On=typeof Symbol!="undefined"&&Symbol.for&&Symbol.for("react.element")||60103,eo=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,to=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,no=/[A-Z0-9]/g,ro=typeof document!="undefined",oo=function(e){return(typeof Symbol!="undefined"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};function xn(e,t,n){return t.__k==null&&(t.textContent=""),Te(e,t),typeof n=="function"&&n(),e?e.__c:null}function kn(e,t,n){return nn(e,t),typeof n=="function"&&n(),e?e.__c:null}te.prototype.isReactComponent=!0,["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(te.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var Pn=g.event;g.event=function(e){return Pn&&(e=Pn(e)),e.persist=function(){},e.isPropagationStopped=function(){return this.cancelBubble},e.isDefaultPrevented=function(){return this.defaultPrevented},e.nativeEvent=e};var Dt,ao={configurable:!0,get:function(){return this.class}},Un=g.vnode;g.vnode=function(e){typeof e.type=="string"&&(function(t){var n=t.props,r=t.type,a={},o=r.indexOf("-")==-1;for(var i in n){var c=n[i];if(!(i==="value"&&"defaultValue"in n&&c==null||ro&&i==="children"&&r==="noscript"||i==="class"||i==="className")){var u=i.toLowerCase();i==="defaultValue"&&"value"in n&&n.value==null?i="value":i==="download"&&c===!0?c="":u==="translate"&&c==="no"?c=!1:u[0]==="o"&&u[1]==="n"?u==="ondoubleclick"?i="ondblclick":u!=="onchange"||r!=="input"&&r!=="textarea"||oo(n.type)?u==="onfocus"?i="onfocusin":u==="onblur"?i="onfocusout":to.test(i)&&(i=u):u=i="oninput":o&&eo.test(i)?i=i.replace(no,"-$&").toLowerCase():c===null&&(c=void 0),u==="oninput"&&a[i=u]&&(i="oninputCapture"),a[i]=c}}r=="select"&&(a.multiple&&Array.isArray(a.value)&&(a.value=ue(n.children).forEach(function(s){s.props.selected=a.value.indexOf(s.props.value)!=-1})),a.defaultValue!=null&&(a.value=ue(n.children).forEach(function(s){s.props.selected=a.multiple?a.defaultValue.indexOf(s.props.value)!=-1:a.defaultValue==s.props.value}))),n.class&&!n.className?(a.class=n.class,Object.defineProperty(a,"className",ao)):n.className&&(a.class=a.className=n.className),t.props=a})(e),e.$$typeof=On,Un&&Un(e)};var Nn=g.__r;g.__r=function(e){Nn&&Nn(e),Dt=e.__c};var Fn=g.diffed;g.diffed=function(e){Fn&&Fn(e);var t=e.props,n=e.__e;n!=null&&e.type==="textarea"&&"value"in t&&t.value!==n.value&&(n.value=t.value==null?"":t.value),Dt=null};var Hn={ReactCurrentDispatcher:{current:{readContext:function(e){return Dt.__n[e.__c].props.value},useCallback:k,useContext:ke,useDebugValue:vt,useDeferredValue:Rt,useEffect:D,useId:mt,useImperativeHandle:ht,useInsertionEffect:It,useLayoutEffect:Se,useMemo:N,useReducer:Ge,useRef:U,useState:j,useSyncExternalStore:St,useTransition:wt}}},io="18.3.1";function Mn(e){return ae.bind(null,e)}function Ue(e){return!!e&&e.$$typeof===On}function $n(e){return Ue(e)&&e.type===Z}function Bn(e){return!!e&&typeof e.displayName=="string"&&e.displayName.indexOf("Memo(")==0}function Vn(e){return Ue(e)?Hr.apply(null,arguments):e}function Wn(e){return!!e.__k&&(Te(null,e),!0)}function jn(e){return e&&(e.base||e.nodeType===1&&e)||null}var Gn=function(e,t){return e(t)},Kn=function(e,t){var n=g.debounceRendering;g.debounceRendering=function(a){return a()};var r=e(t);return g.debounceRendering=n,r},Yn=Ue,so={useState:j,useId:mt,useReducer:Ge,useEffect:D,useLayoutEffect:Se,useInsertionEffect:It,useTransition:wt,useDeferredValue:Rt,useSyncExternalStore:St,startTransition:bt,useRef:U,useImperativeHandle:ht,useMemo:N,useCallback:k,useContext:ke,useDebugValue:vt,version:"18.3.1",Children:Cn,render:xn,hydrate:kn,unmountComponentAtNode:Wn,createPortal:Ln,createElement:ae,createContext:je,createFactory:Mn,cloneElement:Vn,createRef:Yt,Fragment:Z,isValidElement:Ue,isElement:Yn,isFragment:$n,isMemo:Bn,findDOMNode:jn,Component:te,PureComponent:Qe,memo:gn,forwardRef:En,flushSync:Kn,unstable_batchedUpdates:Gn,StrictMode:Z,Suspense:Pe,SuspenseList:be,lazy:Dn,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:Hn};const Xe=Qr(Object.freeze(Object.defineProperty({__proto__:null,Children:Cn,Component:te,Fragment:Z,PureComponent:Qe,StrictMode:Z,Suspense:Pe,SuspenseList:be,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:Hn,cloneElement:Vn,createContext:je,createElement:ae,createFactory:Mn,createPortal:Ln,createRef:Yt,default:so,findDOMNode:jn,flushSync:Kn,forwardRef:En,hydrate:kn,isElement:Yn,isFragment:$n,isMemo:Bn,isValidElement:Ue,lazy:Dn,memo:gn,render:xn,startTransition:bt,unmountComponentAtNode:Wn,unstable_batchedUpdates:Gn,useCallback:k,useContext:ke,useDebugValue:vt,useDeferredValue:Rt,useEffect:D,useErrorBoundary:$r,useId:mt,useImperativeHandle:ht,useInsertionEffect:It,useLayoutEffect:Se,useMemo:N,useReducer:Ge,useRef:U,useState:j,useSyncExternalStore:St,useTransition:wt,version:io},Symbol.toStringTag,{value:"Module"})));var At={exports:{}},Lt,qn;function co(){if(qn)return Lt;qn=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Lt=e,Lt}var Ot,Qn;function uo(){if(Qn)return Ot;Qn=1;var e=co();function t(){}function n(){}return n.resetWarningCache=t,Ot=function(){function r(i,c,u,s,_,l){if(l!==e){var h=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw h.name="Invariant Violation",h}}r.isRequired=r;function a(){return r}var o={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:a,element:r,elementType:r,instanceOf:a,node:r,objectOf:a,oneOf:a,oneOfType:a,shape:a,exact:a,checkPropTypes:n,resetWarningCache:t};return o.PropTypes=o,o},Ot}var Xn;function Jn(){return Xn||(Xn=1,At.exports=uo()()),At.exports}var ne={},Zn;function zn(){if(Zn)return ne;Zn=1,Object.defineProperty(ne,"__esModule",{value:!0}),ne.FrameContextConsumer=ne.FrameContextProvider=ne.useFrame=ne.FrameContext=void 0;var e=Xe,t=n(e);function n(u){return u&&u.__esModule?u:{default:u}}var r=void 0,a=void 0;typeof document!="undefined"&&(r=document),typeof window!="undefined"&&(a=window);var o=ne.FrameContext=t.default.createContext({document:r,window:a});ne.useFrame=function(){return t.default.useContext(o)};var i=o.Provider,c=o.Consumer;return ne.FrameContextProvider=i,ne.FrameContextConsumer=c,ne}var Je={},er;function lo(){if(er)return Je;er=1,Object.defineProperty(Je,"__esModule",{value:!0});var e=(function(){function s(_,l){for(var h=0;h
'},Ce.default=r.default.forwardRef(function(p,f){return r.default.createElement(R,e({},p,{forwardedRef:f}))}),Ce}var nr;function fo(){return nr||(nr=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0});var t=_o();Object.defineProperty(e,"default",{enumerable:!0,get:function(){return r(t).default}});var n=zn();Object.defineProperty(e,"FrameContext",{enumerable:!0,get:function(){return n.FrameContext}}),Object.defineProperty(e,"FrameContextConsumer",{enumerable:!0,get:function(){return n.FrameContextConsumer}}),Object.defineProperty(e,"useFrame",{enumerable:!0,get:function(){return n.useFrame}});function r(a){return a&&a.__esModule?a:{default:a}}})(Tt)),Tt}var po=fo();const xt=qr(po),rr="tabId",or="allTabIds",ar=55,ir=3e3,ho=100,vo=150;var _e=(e=>(e.EQUAL="EQUAL",e.NOT_EQUAL="NOT_EQUAL",e.CONTAINS="CONTAINS",e.NOT_CONTAINS="NOT_CONTAINS",e.STARTS_WITH="STARTS_WITH",e.ENDS_WITH="ENDS_WITH",e.GREATER_THAN="GREATER_THAN",e.LESS_THAN="LESS_THAN",e.BETWEEN="BETWEEN",e.EXISTS="EXISTS",e.GREATER_THAN_EQUAL="GREATER_THAN_EQUAL",e))(_e||{});const mo={REQUEST_TIMEOUT:"Request timeout"},yo=({iconColor:e="#ffffff",height:t="24px",width:n="24px"})=>E("svg",{xmlns:"http://www.w3.org/2000/svg",height:t,viewBox:"0 -960 960 960",width:n,fill:e,children:E("path",{d:"m256-200-56-56 224-224-224-224 56-56 224 224 224-224 56 56-224 224 224 224-56 56-224-224-224 224Z"})}),G={FEEDBACK_WIDGET:"Feedback widget",FEEDBACK_BUTTON_OPEN:"Open survey widget - Share your feedback",FEEDBACK_BUTTON_CLOSE:"Close survey widget",POPUP_WIDGET:"Survey popup",POPUP_FORM:"Survey popup form",EXIT_WIDGET:"Exit survey",EXIT_FORM:"Exit survey form",CLOSE_BUTTON:"Close widget and return to page",SURVEY_FORM:"Survey feedback form",SURVEY_CONTENT:"Survey feedback form content",LAUNCH_SURVEY:"Launch survey",CLOSE_ACTION:"Close"},kt={SURVEY_LOADING:"Loading survey, please wait",SURVEY_MINIMIZED:"Widget minimized",SURVEY_MAXIMIZED:"Widget restored to full size"},go='button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])',Pt={ENTER:"Enter",SPACE:" ",ESCAPE:"Escape"},Re={DIALOG:"dialog",BUTTON:"button",STATUS:"status",DOCUMENT:"document"},sr={ASSERTIVE:"assertive"},cr=({onDone:e})=>{const{colors:{textColor:t,backgroundColor:n,iconColor:r},headerHeight:a,widgetName:o,fontFamily:i}=vn();return E("div",{className:"header","data-testid":"header",style:{height:a,alignItems:parseInt(a,10){const s=qe(),_=U(null),l=U(null);D(()=>{var m,T;if(!i)return;const R=(T=(m=_.current)==null?void 0:m.contentWindow)==null?void 0:T.frameElement,p=R==null?void 0:R.contentWindow;if(!p)return;const f=S=>{S.data==="Responded"&&u()};return p.addEventListener("message",f),()=>{p.removeEventListener("message",f)}},[u,i]),D(()=>{if(!i||!l.current)return;const p=l.current.querySelectorAll(go)[0];p&&p.focus()},[i]),D(()=>{if(!i)return;const R=p=>{p.key==="Escape"&&(p.preventDefault(),n())};return document.addEventListener("keydown",R),()=>{document.removeEventListener("keydown",R)}},[i,n]);const h=N(()=>z(M({position:"fixed"},t),{backgroundColor:"#ffffff",borderRadius:s?0:12,zIndex:1e5,overflow:s?"auto":"hidden",width:s?"100%":o,height:s?"100%":a,maxHeight:"100vh",maxWidth:"100vw",boxShadow:"#00000050 0px 7px 29px 5000px",border:"none"}),[s,t,o,a]),d=k(R=>{if(i)return;const p=R.clientY<=0,f=R.relatedTarget===null;p&&f&&c(!0)},[c,i]),C=k(()=>{i||document.hidden&&c(!0)},[c,i]);return D(()=>{if(!(s||i))return document.addEventListener("mouseout",d),document.addEventListener("visibilitychange",C),()=>{document.removeEventListener("mouseout",d),document.removeEventListener("visibilitychange",C)}},[d,C,s,i]),E(Z,{children:i?E("div",{ref:l,role:Re.DIALOG,"aria-modal":!0,"aria-label":G.EXIT_WIDGET,children:E(xt,{"data-testid":"iframe",head:e,style:h,ref:_,title:G.EXIT_FORM,"aria-label":G.EXIT_FORM,children:E("div",{className:"surveyFrame",style:{height:s?"100%":"100vh"},children:[E(cr,{onDone:n}),r]})})}):null})},Eo="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAMAAADXqc3KAAABCFBMVEUAAADFQTjFQTjFQTjFQTjFQTjFQTjFQTjFQTjFQTjFQTjFQTjFQTjFQTjFQTjFQTjFQTjFQTjFQTjFQTju7u7m1NLm09Lo0M/mz87mz83lz87nzcvnzMvny8nkysjmyMblyMfjycflyMbjyMbmxsTkxsTkxcPnwr/nwb7mwL7mwL3mvrvmvLnde3TdeXLWY1vWYlrWYVnWYVjPX1fVXFTPXlXVWlHPXFPIXFTIW1TOWFDIWFHNVEvhSj/gSj/fST7eST7dST7GUkrGUkncSD7bSD3ZRz3XRzzWRzzWRjzURjzTRjzTRTvRRTvQRTrQRDvQRDrPRDrORDrJQjjIQjnIQjjHQjjGQTjuK3fqAAAAFHRSTlMADBIYGzM2UVp+gYSKjZCWmZyfokeCul8AAAFJSURBVHjafZLZcoIwFIaj1n0B9LS2ttrVahe1drNVk0AFAiKggvr+b9IMwlSnM/4X5yLf5D8rihRLZ0Uxm46hfSWlzXJmmrPlRkqiHRV9g+BAxPCLKFJCcIPnELlCIgSCRQiVKeWRyjxaQujjEqqomqZy8ahQ4gZuKZ8QRdNZKF1TCPFTHJQNTFW989h35nPn5aGjqxQbZYTia4xljT3Bxcdq9XYOz0yTMVnHUWaBMdXY+yWcfX+dwt0n4z/wIoMKUw5UZo+bcHIM92M7ANMCqjCMCQfezzXA7cTjgGDMKkgyAuB4oxpAbeQ5ATAklLO2VoMraDTgZrC1snJR8l4VmpNJE6o9pgXJo3LbUB963rAO7bDcqMFu69V2HLvf6oYNHhgJKrlE3h2iTNzS4bGjo/+LOrza6Bgs07SWm3IK7SuWzoti/u98fgGMv2Ka6B/JVwAAAABJRU5ErkJggg==";var Ze=(e=>(e.HTML_ELEMENT="HTML_ELEMENT",e.DATA_LAYER="DATA_LAYER",e.URL_PARAM="URL_PARAM",e))(Ze||{}),we=(e=>(e.PROCEED="PROCEED",e.SKIP="SKIP",e.EXCLUDE="EXCLUDE",e))(we||{}),ur=(e=>(e.ltr="ltr",e.rtl="rtl",e))(ur||{});const So=(e,t,n)=>{const r=k(a=>{a.key===Pt.ESCAPE&&!e&&(a.preventDefault(),t())},[e,t]);return D(()=>(document.addEventListener("keydown",r),()=>{document.removeEventListener("keydown",r)}),[r]),D(()=>{},[e,n]),{handleEscapeKey:r}},lr=e=>({handleKeyDown:k(n=>{(n.key===Pt.ENTER||n.key===Pt.SPACE)&&(n.preventDefault(),e())},[e])}),Co=(e,t,n)=>{const r=U(!1);D(()=>{if(!r.current){r.current=!0;return}!e&&(n!=null&&n.current)?n.current.focus():e&&(t!=null&&t.current)&&t.current.focus()},[e,t,n])},bo=({feedbackBtnHeight:e,feedbackBtnWidth:t,color:n,backgroundColor:r,head:a,isMinimized:o,children:i,onMinimize:c,logoNameObject:u,surveyPosition:s,position:_,widgetWindowHeight:l,widgetWindowWidth:h,handleSurveyCompletion:d})=>{const C=U(null),R=U(null),p=U(null),f=U(null),m=qe();Co(o,R,p);const{handleKeyDown:T}=lr(c);So(o,c),D(()=>{var W,L;const y=(L=(W=C.current)==null?void 0:W.contentWindow)==null?void 0:L.frameElement,w=y==null?void 0:y.contentWindow;if(!w)return;const b=B=>{B.data==="Responded"&&d()};return w.addEventListener("message",b),()=>{w.removeEventListener("message",b)}},[d]),D(()=>{if(f.current){const y=o?kt.SURVEY_MINIMIZED:kt.SURVEY_MAXIMIZED;f.current.textContent=y}},[o]);const S=N(()=>u.feedbackBtnType===Ye.Logo,[u.feedbackBtnType]),A=N(()=>S?45:t,[t,S]),$=N(()=>{switch(_){case I.CENTER_LEFT:case I.CENTER_RIGHT:return!0;default:return!1}},[_]),F=N(()=>{var y;return typeof document=="undefined"?!1:((y=document==null?void 0:document.documentElement)==null?void 0:y.dir)===ur.rtl},[]),Q=N(()=>{switch(_){case I.TOP_CENTER:return{flexDirection:"column-reverse",transform:o?`translate(-50%,calc(-100% + ${A}px))`:"translate(-50%,0%)"};case I.TOP_LEFT:return{flexDirection:"column-reverse",transform:o?`translate(0,calc(-100% + ${A}px))`:"translate(0,0)"};case I.TOP_RIGHT:return{flexDirection:"column-reverse",transform:o?`translate(0,calc(-100% + ${A}px))`:"translate(0,0)"};case I.BOTTOM_LEFT:return{flexDirection:"column",transform:o?`translate(0%,calc(100% - ${A}px))`:"translate(0%,0%)"};case I.BOTTOM_CENTER:return{flexDirection:"column",transform:o?`translate(-50%,calc(100% - ${A}px))`:"translate(-50%,0%)"};case I.BOTTOM_RIGHT:return{flexDirection:"column",transform:o?`translate(0%,calc(100% - ${A}px))`:"translate(0%,0%)"};case I.CENTER_LEFT:return{transform:o?`translate(calc(-100% + ${A}px),-50%)`:"translateY(-50%)",flexDirection:F?"row":"row-reverse"};case I.CENTER_RIGHT:default:return{transform:o?`translate(calc(100% - ${A}px), -50%)`:"translateY(-50%)",flexDirection:F?"row-reverse":"row"}}},[A,F,o,_]),V=N(()=>{switch(_){case I.CENTER_LEFT:case I.CENTER_RIGHT:return m?"95%":h+A;default:return m?o?"auto":"95%":h}},[m,_,A,o,h]),Y=N(()=>{switch(_){case I.BOTTOM_CENTER:case I.BOTTOM_LEFT:case I.TOP_CENTER:case I.TOP_LEFT:return"flex-end";default:return"flex-start"}},[_]),se=N(()=>z(M(z(M({position:"fixed"},s),{zIndex:1e8}),Q),{transition:"transform 0.3s",display:"flex",alignItems:o?"center":Y,width:V,height:m?o?"auto":"95%":void 0,maxHeight:"calc(100vh - 15px)",maxWidth:"100vw",boxShadow:o?"none":"#00000050 0px 7px 29px 5000px",backgroundColor:o?"transparent":"#00000050"}),[Q,s,V,o,Y,m]),ye=N(()=>{switch(_){case I.CENTER_LEFT:case I.CENTER_RIGHT:return{height:e,width:t};default:return{height:t,width:e}}},[e,t,_]),X=N(()=>z(M(z(M(M({},ye),(u==null?void 0:u.feedbackBtnType)===Ye.Logo?{width:45,height:50,borderRadius:"50%"}:{}),{backgroundColor:r,color:n,fontSize:14,cursor:"pointer",position:"relative",fontFamily:"FiraSans-Regular, sans-serif"}),u.isTransparent?{backgroundColor:"transparent"}:{}),{border:"none",pointerEvents:"auto",padding:0}),[r,n,ye,u==null?void 0:u.feedbackBtnType,u.isTransparent]),ce=N(()=>{const y={background:"transparent",border:"none",cursor:"pointer",position:"absolute",zIndex:"1000",padding:0};switch(_){case I.CENTER_RIGHT:case I.BOTTOM_RIGHT:return z(M({},y),{top:"-12px",left:"-12px"});case I.TOP_CENTER:case I.TOP_LEFT:return z(M({},y),{bottom:"-12px",right:"-12px"});case I.TOP_RIGHT:return z(M({},y),{bottom:"-12px",left:"-12px"});default:return z(M({},y),{top:"-12px",right:"-12px"})}},[_]),De=k(()=>E("button",{ref:p,style:ce,className:"button done","data-testid":"done-button",onClick:c,"aria-label":G.CLOSE_BUTTON,title:G.CLOSE_ACTION,type:"button",children:E("img",{src:Eo,alt:G.CLOSE_ACTION})}),[ce,c]);return E("div",{style:se,onClick:y=>{o||y.target.id!=="intercept-feedback-container"||c()},id:"intercept-feedback-container",role:Re.DIALOG,"aria-modal":!o,"aria-label":G.FEEDBACK_WIDGET,children:[E("div",{ref:f,"aria-live":sr.ASSERTIVE,"aria-atomic":"true",className:"sr-only"}),E("div",{style:{display:"inline-block",position:"relative"},children:[!o&&De(),E("button",{ref:R,style:X,onClick:c,onKeyDown:T,"data-testid":"feedback-frame-btn","aria-label":`${(u==null?void 0:u.feedbackLogoName)||"Feedback"} button. ${o?G.FEEDBACK_BUTTON_OPEN:G.FEEDBACK_BUTTON_CLOSE}`,"aria-expanded":!o,role:Re.BUTTON,type:"button",tabIndex:0,children:E("div",{style:M({width:"30px",display:"flex",flexDirection:$?"column-reverse":"row",justifyContent:"center",height:"100%",gap:10,margin:"auto"},$?{}:{alignItems:"center"}),children:[(u==null?void 0:u.feedbackLogoKey)&&E("img",{src:mn.generateAwsUrl(u.feedbackLogoKey),alt:"",role:"presentation",style:{width:"100%"}}),!S&&E("div",{style:{transform:$?"rotate(-90deg)":"rotate(0deg)"},"aria-hidden":"true",children:E("span",{style:{whiteSpace:"nowrap",display:"flex",justifyContent:"center",alignItems:"center",lineHeight:"normal"},children:u==null?void 0:u.feedbackLogoName})})]})})]}),E(xt,{head:a,"data-testid":"feedback-iframe",height:m?"100%":l,width:m?"100%":h,style:{backgroundColor:"#ffffff",zIndex:1e5,border:"none",display:o?"none":"block",pointerEvents:o?"none":"auto"},ref:C,title:G.SURVEY_FORM,"aria-label":G.SURVEY_CONTENT,tabIndex:o?-1:void 0,"aria-hidden":o,role:Re.DOCUMENT,children:E("div",{className:o?"":"surveyFrame",style:{height:m?"100%":"100vh"},children:i})})]})},Ro=({head:e,surveyPosition:t,onDone:n,widgetWindowHeight:r,widgetWindowWidth:a,children:o,handleSurveyCompletion:i})=>{const c=qe(),u=U(null),s=U(null);D(()=>{var C,R;const l=(R=(C=u.current)==null?void 0:C.contentWindow)==null?void 0:R.frameElement,h=l==null?void 0:l.contentWindow;if(!h)return;const d=p=>{p.data==="Responded"&&i()};return h.addEventListener("message",d),()=>{h.removeEventListener("message",d)}},[i]);const _=M(z(M({position:"fixed"},c?{}:t),{backgroundColor:"#ffffff",borderRadius:c?0:12,zIndex:1e5,overflow:"auto",width:c?"80%":a,height:c?"80%":r,maxHeight:"100vh",maxWidth:"100vw",boxShadow:"#00000050 0px 7px 29px 5000px",border:"none"}),c?{top:"50%",left:"50%",transform:"translate(-50%, -50%)"}:{});return E("div",{ref:s,role:Re.DIALOG,"aria-modal":!0,"aria-label":G.POPUP_WIDGET,children:E(xt,{"data-testid":"popup-frame",head:e,style:_,ref:u,title:G.POPUP_FORM,"aria-label":G.POPUP_FORM,children:E("div",{className:"surveyFrame",style:{height:c?"100%":"100vh"},children:[E(cr,{onDone:n}),o]})})})};/*! js-cookie v3.0.5 | MIT */function ze(e){for(var t=1;t{try{const e=sessionStorage.getItem(Nt);if(e)return e;const t=document.referrer,r=(()=>{if(!t)return!1;try{return new URL(t).origin!==location.origin}catch(a){return!1}})()?t:et;return sessionStorage.setItem(Nt,r),r}catch(e){return et}},getReferrerUrl:()=>{try{return sessionStorage.getItem(Nt)||et}catch(e){return et}}};class Io{constructor(t={}){this.baseURL=t.baseURL||"",this.defaultHeaders=t.headers||{},this.timeout=t.timeout||1e4}async request(t,n,r,a={}){const o=n.startsWith("http")?n:`${this.baseURL}${n}`,i=M(M({"Content-Type":"application/json"},this.defaultHeaders),a.headers),c=new AbortController,u=setTimeout(()=>c.abort(),this.timeout);try{const s=await fetch(o,{method:t,headers:i,body:r?JSON.stringify(r):void 0,signal:c.signal});if(clearTimeout(u),!s.ok){const h=new Error(`HTTP ${s.status}: ${s.statusText}`);throw h.response={status:s.status,statusText:s.statusText,headers:s.headers},h}const _=await s.json();return{data:_!==null&&typeof _=="object"&&"data"in _?_.data:_,status:s.status,statusText:s.statusText,headers:s.headers}}catch(s){throw clearTimeout(u),s instanceof Error&&s.name==="AbortError"?new Error(mo.REQUEST_TIMEOUT):s}}async get(t,n){return this.request("GET",t,void 0,n)}async post(t,n,r){return this.request("POST",t,n,r)}async put(t,n,r){return this.request("PUT",t,n,r)}async delete(t,n){return this.request("DELETE",t,void 0,n)}}const me=(e=>new Io(e))({baseURL:Kr}),Ne={getVisitor:e=>{const t={};return e&&(t["visitor-id"]=e),me.get("/api/v1/visitor",{headers:M({"x-app-key":window.Intercept.apiKey},t)})},getSettings:e=>me.get(`/api/v1/widget-settings/intercept/${e}`,{headers:{"x-app-key":window.Intercept.apiKey}}),getDataMappings:e=>me.get(`/api/v1/data-mapping/intercept/${e}`,{headers:{"x-app-key":window.Intercept.apiKey}}),sendDataMappings:(e,t,n,r,a,o,i)=>{const c=Ft.getReferrerUrl();return me.post(`/api/v1/data-mapping/intercept/${e}/survey/${t}`,{data:n,visitedUserId:a,websiteDetails:r,entryReferrer:c,pagePathHistory:i,isSkipAnalytics:o},{headers:{"x-app-key":window.Intercept.apiKey,"x-screen-resolution":`${window.screen.width}x${window.screen.height}`,"x-browser-language":navigator.language,"visitor-id":a}}).then(u=>u).catch(u=>{throw u})},sendVisitorSurveyFeedback:e=>{const t={"x-app-key":window.Intercept.apiKey},n=re.get("visitorId");return n&&(t["visitor-id"]=n),me.post("/api/v1/visitor/survey-feedback",e,{headers:t})},sendExcludedInterceptFeedback:e=>{const t={"x-app-key":window.Intercept.apiKey},n=re.get("visitorId");return n&&(t["visitor-id"]=n),me.post("/api/v1/visitor/excluded-feedback",e,{headers:t})},sendSurveyCloseEvent:(e,t)=>{const n=re.get("visitorId"),r={"x-app-key":window.Intercept.apiKey};return n&&(r["visitor-id"]=n),me.post("/api/v1/visitor/survey/clicked-x",{surveyId:e,ruleGroupId:t,visitorId:n},{headers:r})}},_r="_cx_ia_path",Ht=10,tt=()=>{try{const e=localStorage.getItem(_r);if(!e)return{history:[],historyUpdated:!1};const t=JSON.parse(e),n=Array.isArray(t.history)?t.history.filter(a=>typeof a=="string").slice(-Ht):[],r=typeof t.historyUpdated=="boolean"?t.historyUpdated:!1;return{history:n,historyUpdated:r}}catch(e){return{history:[],historyUpdated:!1}}},Do=e=>{try{localStorage.setItem(_r,JSON.stringify(e))}catch(t){console.warn("Failed to save history to localStorage:",t)}},nt={checkHistoryUpdated:()=>{try{return tt().historyUpdated}catch(e){return!1}},updatePageHistory:(e=location.href)=>{try{const t=tt();let{history:n}=t,r=!1;if(n[n.length-1]!==e){const o=[...n,e];n=o.length>Ht?o.slice(-Ht):o,r=!0}else r=!1;const a={history:n,historyUpdated:r};return Do(a),a}catch(t){return{history:tt().history,historyUpdated:!1}}},getPageHistory:()=>tt().history},fr={hashString:e=>{let t=5381;for(let n=0;n>>0).toString(36)}},dr="_cx_i_analytics_events",pr=()=>{try{const e=sessionStorage.getItem(dr);return e?JSON.parse(e):{}}catch(e){return console.error("[Analytics Tracker] Error reading tracker:",e),{}}},hr=(e,t,n,r,a)=>{const o=r||"DIRECT",i=n||0,c=fr.hashString(o),u=fr.hashString(a);return`${e}_${t}_${i}_${c}_${u}`},Ao={getAnalyticsTracker:pr,generateTrackingKey:hr,shouldTrackAnalytics:(e,t,n,r,a)=>{try{if(!e)return!0;const o=nt.checkHistoryUpdated(),i=pr(),c=hr(e,t,n,r,a),u=i[c],s=o||!u;if(i[c]=!0,!s)return!1;try{sessionStorage.setItem(dr,JSON.stringify(i))}catch(_){return!0}return!0}catch(o){return!0}}};function vr(e,t){(!re.get("startTime")||e)&&re.set("startTime",e||Date.now().toString(),{expires:t||365})}function mr(){return re.get("startTime")||vr(),re.get("startTime")}function Lo(){const e=mr(),t=(Date.now()-Number(e))/1e3;return parseFloat(t.toFixed(0))}function Oo(e){const[t,n]=e.split("."),r=parseInt(t,10)||0,a=parseInt(n,10)||0;return r*60+a}const Ie={setStartTimeCookie:vr,getStartTimeCookie:mr,getSessionDurationInSeconds:Lo,parseCustomTime:Oo},yr={getNestedProperty:e=>{if(!e)return window;const t=e.split(".");let n=window;for(const r of t){if(!n||typeof n!="object"||!(r in n))return;n=typeof n[r]=="function"?n[r]():n[r]}return n}},xo={clamp:(e,t,n)=>Math.min(n,Math.max(t,e))},Mt={calculateScrollDepth:()=>{const e=window.scrollY,t=window.innerHeight,n=document.documentElement.scrollHeight;if(n<=t)return 100;const r=e/(n-t)*100,a=Math.round(r);return xo.clamp(a,0,100)}},gr="intercept_visited_count",Tr="intercept_last_page",Er=()=>{const e=localStorage.getItem(gr);return e?parseInt(e,10):0},Sr=()=>localStorage.getItem(Tr)||"",Cr={getVisitCount:Er,getLastVisitedPage:Sr,updatePageVisit:e=>{const t=Sr();let n=Er();return e!==t&&(n+=1,localStorage.setItem(gr,n.toString()),localStorage.setItem(Tr,e)),n}};var Fe=(e=>(e.SERVER="server",e.CLIENT="client",e))(Fe||{}),rt=(e=>(e.AND="AND",e.OR="OR",e))(rt||{}),ot=(e=>(e.COUNTRY="COUNTRY",e.WEBSITE_LANGUAGE="WEBSITE_LANGUAGE",e.BROWSER_TYPE="BROWSER_TYPE",e.BROWSER_ENGINE="BROWSER_ENGINE",e.USER_TYPE="USER_TYPE",e.DEVICE_TYPE="DEVICE_TYPE",e.OS="OS",e.PAGE_VISITS="PAGE_VISITS",e.PAGE_TITLE="PAGE_TITLE",e.PAGE_URL="PAGE_URL",e.TOTAL_VISITS="TOTAL_VISITS",e.PAGE_VISITED="PAGE_VISITED",e.BUTTON="BUTTON",e.SESSION_DURATION="SESSION_DURATION",e.JAVASCRIPT_EXCEPTION="JAVASCRIPT_EXCEPTION",e.QUERY_PARAM="QUERY_PARAM",e.DATA_LAYER="DATA_LAYER",e.IP="IP",e.SCROLL_DEPTH="SCROLL_DEPTH",e))(ot||{});function $t(e,t){try{const n=e.querySelector(t);if(n)return n;const r=e.querySelectorAll("*");for(let a=0;a{var t;try{if(!e)return{element:null,text:"",exists:!1};let n=document.querySelector(e);return n||(n=$t(document,e)),{element:n,text:((t=n==null?void 0:n.textContent)==null?void 0:t.trim())||"",exists:!!n}}catch(n){return console.error("Error finding element:",n),{element:null,text:"",exists:!1}}},findInShadow:e=>{var n;const t=$t(document,e);return{element:t,text:((n=t==null?void 0:t.textContent)==null?void 0:n.trim())||"",exists:!!t}}};function de(e,t,n){switch(e){case _e.EQUAL:return t===n;case _e.NOT_EQUAL:return t!==n;case _e.CONTAINS:return t==null?void 0:t.includes(n);case _e.NOT_CONTAINS:return!(t!=null&&t.includes(n));case _e.GREATER_THAN:return parseFloat(t)>parseFloat(n);case _e.LESS_THAN:return parseFloat(t)=parseFloat(n);default:return!1}}const Po={BUTTON:(e,t)=>{var o,i;if(!t)return!1;const n=((o=e==null?void 0:e.value)!=null?o:"").trim();if(!n)return!1;const r=t.tagName,a=r==="BUTTON"||r==="A"?t:t.closest("button, a");return a?de(e.operand,(i=a.id)!=null?i:"",n):!1},PAGE_URL:e=>{const t=window.location.href;return de(e==null?void 0:e.operand,t,e==null?void 0:e.value)},SESSION_DURATION:e=>{const t=Ie.getSessionDurationInSeconds().toString(),n=Ie.parseCustomTime(e==null?void 0:e.value);return de(e.operand,t,n.toString())},QUERY_PARAM:e=>{const t=new URLSearchParams(window.location.search),n=e!=null&&e.key?t.get(e==null?void 0:e.key):"";return n?de(e==null?void 0:e.operand,n,e==null?void 0:e.value):!1},DATA_LAYER:e=>{const t=(e==null?void 0:e.key)&&yr.getNestedProperty(e==null?void 0:e.key);return t==null?!1:de(e.operand,t.toString(),e.value)},PAGE_VISITED:e=>{const t=Cr.getVisitCount();return de(e.operand,t.toString(),e.value)},HTML_SELECTOR:e=>{const t=e==null?void 0:e.key;if(!t)return!1;try{const{element:n,text:r}=ko.findElement(t);return(e==null?void 0:e.operand)===_e.EXISTS?!!n:!n||!(e!=null&&e.value)||e.value.trim()===""?!1:de(e.operand,r,e.value)}catch(n){return console.error("Error evaluating HTML_SELECTOR:",n),!1}},SCROLL_DEPTH:(e,t,n)=>{var a;const r=(a=n==null?void 0:n.scrollDepth)!=null?a:0;return de(e.operand,r.toString(),e.value)}};function br(e,t,n){if(!e.name)return!1;const r=Po[e.name];return typeof r!="function"?!1:r(e,t,n)}function Rr(e,t,n){return e.type.toLowerCase()===Fe.SERVER?!!e.isMatching:br(e,t,n)}function wr(e,t,n){var i;const r=(i=e==null?void 0:e.rules)!=null?i:[];if(!r.length)return!t;const a=r.map(c=>Rr(c,t,n)),o=r.some(c=>c.name==="BUTTON");return t&&o&&e.condition!==rt.OR&&!r.some((u,s)=>u.name==="BUTTON"&&a[s])?!1:e.condition===rt.AND?a.every(Boolean):e.condition===rt.OR?a.some(Boolean):!1}function Uo(e,t,n){for(const r of e)if(wr(r,t,n))return r;return null}const No={evaluateClientRule:br,evaluateRule:Rr,evaluateIntercept:wr,findFirstMatchingIntercept:Uo},Ir=e=>`${e.pathname}${e.search}`,Fo=({visitorData:e,setIsPageChanged:t,handleInterceptChecks:n,resetPageState:r,dismissInterceptWidget:a})=>{const o=U(e),i=U(typeof window!="undefined"?Ir(window.location):"");D(()=>{o.current=e},[e]);const c=k(async()=>{const u=Ir(window.location),s=o.current;if(nt.updatePageHistory(),!s)return;u!==i.current&&(i.current=u,r?r():a(),t&&t(!0),n&&setTimeout(()=>{n(s)},100))},[t,n,r,a]);D(()=>{if(!e)return;const u=window.history.pushState,s=window.history.replaceState;window.history.pushState=function(...l){u.apply(this,l),c()},window.history.replaceState=function(...l){s.apply(this,l),c()};const _=()=>{c()};return window.addEventListener("popstate",_),()=>{window.history.pushState=u,window.history.replaceState=s,window.removeEventListener("popstate",_)}},[e,c])},Dr=je({}),Ho=({children:e})=>{const[t,n]=j(""),[r,a]=j(null),[o,i]=j(null),c=U(!1),[u,s]=j(null),[_,l]=j(!1),h=U(0),d=U(new Set),C=U(new Map),R=U([]),p=U([]),f=k(v=>v.map(({type:w,value:b,variable:W})=>{if(w===Ze.HTML_ELEMENT){const L=document.getElementById(b);return L?{value:L.innerHTML,variableName:W}:null}if(w===Ze.DATA_LAYER){const L=yr.getNestedProperty(b);return L?{value:L,variableName:W}:null}if(w===Ze.URL_PARAM){const L=new URLSearchParams(window.location.search).get(b);return L?{value:L,variableName:W}:null}return null}).filter(Boolean),[]),m=k(async()=>{if(p.current.length!==0)try{await Ne.sendExcludedInterceptFeedback(p.current),p.current=[]}catch(v){console.error("Failed to send batch excluded feedback:",v)}},[]),T=v=>{var y;return(y=v==null?void 0:v.rules)==null?void 0:y.some(w=>(w==null?void 0:w.type)===Fe.CLIENT&&(w==null?void 0:w.name)===ot.SESSION_DURATION)},S=(v,y)=>{a({surveyId:v.surveyId,surveyUrl:y.surveyURL,type:v.type,interceptId:v.id,ruleGroupId:v.ruleGroupId}),n(y.surveyURL)},A=k(v=>R.current.includes(v),[]),$=k(v=>{var L,B,H;const y=(L=v.settings)==null?void 0:L.samplingRate;if(!y||y>=100)return!0;if(y<=0)return!1;const w=((B=v.metaData)==null?void 0:B.matchedCount)||0,b=((H=v.metaData)==null?void 0:H.excludedCount)||0;return w*100/(w+b+1){var B,H;const{project:w}=v,b=window.location.pathname;if(c.current&&!_)return;Cr.updatePageVisit(b),p.current=[];const W=w.intercepts.filter(x=>!A(x.surveyId)),L=(x,ee)=>No.evaluateIntercept(x,ee,{scrollDepth:h.current})?(d.current.add(`${x.id}-${b}`),V(x),!0):!1;for(const x of W){const ee=(B=x.metaData)==null?void 0:B.visitorStatus;if(Q(x,ee,p.current)!==we.SKIP){if((H=x==null?void 0:x.settings)!=null&&H.triggerDelayInSeconds){const Ae=String(x.id);if(C.current.has(Ae))continue;const Bt=setTimeout(()=>{C.current.delete(Ae),!c.current&&(A(x.surveyId)||L(x,y))},x.settings.triggerDelayInSeconds*1e3);C.current.set(Ae,Bt);continue}if(L(x,y))return}}await m()},[$,m,_,A]),Q=(v,y,w)=>{var B;const b=(B=v.settings)==null?void 0:B.samplingRate;return b&&b<100?y===he.EXCLUDED?we.SKIP:y===he.MATCHED||y===he.LAUNCHED||$(v)?we.PROCEED:(w.push({surveyId:v.surveyId,ruleGroupId:v.ruleGroupId,surveyType:he.EXCLUDED,interceptId:v.id}),we.SKIP):we.PROCEED},V=async v=>{var x;c.current=!0,i(v),l(!1);const y=f(v.dataMappings),w={websiteUrl:window.location.href,websiteLanguage:(x=v==null?void 0:v.settings)!=null&&x.autoLanguageSelection?document.documentElement.lang:""},b=re.get("visitorId"),W=Ft.getReferrerUrl(),L=window.location.href,B=Ao.shouldTrackAnalytics(b,v.id,v.surveyId,W,L),H=nt.getPageHistory();try{const{data:ee}=await Ne.sendDataMappings(v.id,v.surveyId,y,w,b,!B,H);T(v)?setTimeout(()=>{S(v,ee)},ir):S(v,ee),b&&p.current.length>0&&await m()}catch(ee){console.error("Failed to execute API call:",ee),c.current=!1,i(null)}},Y=k(v=>{u&&F(u,v)},[u,F]),se=k(async(v,y)=>{if(!y)return;const w=window.location.pathname,b=`${v}-${y.surveyId}-${w}`;if(!d.current.has(b))try{await Ne.sendVisitorSurveyFeedback({surveyId:y.surveyId,ruleGroupId:y.ruleGroupId,surveyType:v,interceptId:y.interceptId}),d.current.add(b)}catch(W){console.error("Failed to send survey feedback:",W)}},[]),ye=k(()=>{se(he.LAUNCHED,r)},[r,se]);D(()=>{r&&se(he.MATCHED,r)},[r,se]),D(()=>{(async()=>{const v=re.get("visitorId")||"",{data:y}=await Ne.getVisitor(v),w=Ie.getStartTimeCookie(),b=y.project.settings&&y.project.settings[0].value?y.project.settings[0].value:365;re.set("visitorId",y.visitor.uuid||"",{expires:b}),Ie.setStartTimeCookie(w,b),s(y),h.current=Mt.calculateScrollDepth(),F(y)})()},[]),D(()=>{const v=y=>{const w=y.target;Y(w)};return document.addEventListener("click",v),()=>{document.removeEventListener("click",v)}},[Y]),D(()=>{var y;if(!u)return;let v=!1;(y=u==null?void 0:u.project)==null||y.intercepts.forEach(w=>{if(v=T(w),v)for(const b of w.rules)b.type===Fe.CLIENT&&(b==null?void 0:b.name)===ot.SESSION_DURATION&&setTimeout(()=>{F(u)},1e3*Ie.parseCustomTime(b==null?void 0:b.value)+ir)}),v||re.remove("startTime")},[u,F]);const X=k(()=>{c.current=!1,n(""),a(null),i(null)},[]);D(()=>{if(!u||!u.project.intercepts.some(H=>{var x;return(x=H.rules)==null?void 0:x.some(ee=>ee.type===Fe.CLIENT&&ee.name===ot.SCROLL_DEPTH)}))return;let y=Mt.calculateScrollDepth();h.current=y;const w=()=>{const H=Mt.calculateScrollDepth();H!==y&&(y=H,h.current=H,F(u))},b=new ResizeObserver(()=>{w()});let W=0,L=null;const B=()=>{const H=Date.now();if(L&&clearTimeout(L),H-W{w()},vo);return}W=H,w()};return window.addEventListener("scroll",B,{passive:!0}),b.observe(document.body),()=>{L&&clearTimeout(L),window.removeEventListener("scroll",B),b.disconnect()}},[u,F]);const ce=k(()=>{var v;r&&Ne.sendSurveyCloseEvent(r.surveyId,r.ruleGroupId),r!=null&&r.surveyId&&!((v=o==null?void 0:o.settings)!=null&&v.allowMultipleResponse)&&(R.current=[...R.current,r.surveyId]),X()},[r,o,X]),De=k(()=>{X(),d.current.clear(),C.current.forEach(v=>clearTimeout(v)),C.current.clear(),p.current=[]},[X]);return D(()=>{Ie.setStartTimeCookie()},[]),D(()=>()=>{C.current.forEach(v=>clearTimeout(v)),C.current.clear()},[]),Fo({visitorData:u,setIsPageChanged:l,handleInterceptChecks:F,resetPageState:De,dismissInterceptWidget:X}),E(Dr.Provider,{value:{surveyUrl:t,survey:r,matchedIntercept:o,closeSurvey:ce,launchSurveyForVisitor:ye,isPageChange:_},children:e})},Ar=()=>ke(Dr),Mo=({survey:e,styles:t,surveyUrl:n})=>{const[r,a]=j(e.type===ie.Feedback),{closeSurvey:o,launchSurveyForVisitor:i,isPageChange:c,matchedIntercept:u}=Ar(),[s,_]=j(!1),[l,h]=j(e.type!==ie.Exit),d=qe(),C=500,R=U(null),{widgetDescription:p,colors:{backgroundColor:f,textColor:m},position:T,fontFamily:S,headerHeight:A,fetchWidgetSettings:$,feedbackBtnHeight:F,feedbackBtnWidth:Q,imageKey:V,imageDetailsObject:Y,descriptionDetailsObject:se,logoNameObject:ye,widgetWindowHeight:X,widgetWindowWidth:ce,isAutoLaunchEnabled:De,launchSurveyBtnObject:v}=vn();D(()=>{e!=null&&e.interceptId&&$&&(c||!p)&&u&&$(u)},[$,e==null?void 0:e.interceptId,p,c,u]);const y=k(()=>a(q=>!q),[]),w=N(()=>E("iframe",{id:"survey",src:n,allowFullScreen:!0,height:d?"100%":X,width:d?"100%":ce,style:{position:"fixed",border:"none "}}),[d,n,X,ce]),b=k(()=>{R.current&&(R.current.textContent=kt.SURVEY_LOADING),_(!0),i()},[i]),{handleKeyDown:W}=lr(b),L=k(()=>{var q;(q=u==null?void 0:u.settings)!=null&&q.autoCloseOnCompletion&&o()},[o,u]);D(()=>{De&&(s||r||b())},[De,r,s,b]),D(()=>{const q=document.getElementById("intercept-app"),Ae=Bt=>{e.type===ie.Feedback&&!(q!=null&&q.contains(Bt.target))&&a(!0)};return document.addEventListener("click",Ae),()=>{document.removeEventListener("click",Ae)}},[]);const B=N(()=>{if(s)return w;if(r)return null;const q={backgroundColor:f,color:m,fontFamily:`'${S}', sans-serif`};return E("div",{className:"launch-survey_container",style:{position:"relative",overflow:"hidden",height:e.type===ie.Feedback?d?C:X:d?C:`calc(100vh - ${A})`},children:[V&&E("div",{style:z(M({},Y),{position:"absolute"}),children:E("img",{src:mn.generateAwsUrl(V),alt:"intercept_widget_image",style:{width:"100%",height:"100%",objectFit:"cover"}})}),E("div",{className:"widget-description-btn-content",style:M({},se?M({position:"absolute"},se):{height:"100%"}),children:[E("div",{dangerouslySetInnerHTML:{__html:p}}),E("div",{children:[E("div",{ref:R,role:Re.STATUS,"aria-live":sr.ASSERTIVE,"aria-atomic":"true",className:"sr-only"}),E("button",{className:"launch-survey_container-launchSurvey",onClick:b,onKeyDown:W,style:q,"aria-label":G.LAUNCH_SURVEY,type:"button",children:v==null?void 0:v.name})]})]})]})},[s,r,f,m,S,e.type,A,V,Y,se,p,b,w]),H=N(()=>Gr.getSurveyPosition(T,r,e.type,d),[T,r,e.type,d]);D(()=>{if(l&&!r){const q=document.createElement("style");return q.textContent=` body:not(iframe body) { position: relative; height: 100vh; z-index: -1; overflow: auto; user-select: none; } body:before { position: fixed; content: ''; left: 0; right: 0; top: 0; bottom: 0; z-index: 200; } `,document.head.appendChild(q),()=>{document.body.style.backgroundColor="",document.head.removeChild(q)}}},[r,l]);const x=N(()=>E(Z,{children:[E("style",{children:t}),E("link",{href:`https://fonts.googleapis.com/css2?family=${S.replaceAll(" ","+")}:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap`,rel:"stylesheet"})]}),[S,t]);return N(()=>{if(!(H||T))return null;switch(e.type){case ie.Feedback:return E(bo,{onDone:o,isMinimized:r,feedbackBtnHeight:F,feedbackBtnWidth:Q,backgroundColor:f,color:m,onMinimize:y,logoNameObject:ye,surveyPosition:H,position:T,head:x,widgetWindowHeight:X,widgetWindowWidth:ce,handleSurveyCompletion:L,children:B});case ie.Popup:return E(Ro,{head:x,surveyPosition:H,onDone:o,widgetWindowHeight:X,widgetWindowWidth:ce,handleSurveyCompletion:L,children:B});case ie.Exit:return E(To,{head:x,surveyPosition:H,onDone:o,widgetWindowHeight:X,widgetWindowWidth:ce,showSurvey:l,setShowSurvey:h,handleSurveyCompletion:L,children:B})}},[f,m,B,F,Q,x,r,ye,o,y,T,e.type,H,l])},$o=()=>{const{survey:e,surveyUrl:t}=Ar(),n=U(),[r,a]=j(!0),[o,i]=j(null),c=k(()=>JSON.parse(localStorage.getItem(or)||"[]"),[]);D(()=>{const s=c();let _=sessionStorage.getItem(rr);_||(_=Date.now().toString(),sessionStorage.setItem(rr,_),i(_)),s&&(s.push(_),localStorage.setItem(or,JSON.stringify(s))),i(_)},[c]);const u=k(()=>{const s=c();s[(s==null?void 0:s.length)-1]!==o&&a(!1)},[o]);return D(()=>(document.addEventListener("visibilitychange",u),()=>document.removeEventListener("visibilitychange",u)),[o]),D(()=>{var s;n.current=(s=document.getElementById("intercept-stylesheet"))==null?void 0:s.innerHTML},[e==null?void 0:e.interceptId]),E("div",{className:"accessibility-enabled",children:t&&e&&r&&E(Mo,{survey:e,styles:n.current,surveyUrl:t,"data-testid":"survey-frame"})||null})};try{Ft.captureEntryReferrerUrl(),nt.updatePageHistory()}catch(e){console.warn("Failed to capture referrer or page history")}let He=document.getElementById("intercept-app");He||(He=document.createElement("div"),He.setAttribute("id","intercept-app"),document.body.appendChild(He)),Te(E(Ho,{children:E(Wr,{children:E($o,{})})}),He)})(); })();